<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>

</head>
<body>
	<form action="" method="post">
		<input type="text" name="phone" id="phone" value="">
		<a href="javascript:void(0)" id="sendSms">发送验证码</a>
		<button>提交</button>
	</form>

	<script src="/Thinkphp05/ThinkPHP_3.2.2_full/Public/jquery-1.8.3.min.js"></script>
	<script>
	// 发送短信的请求
	$(function(){
		$('#sendSms').click(function(){
			// 将手机号码发送到服务器
			var phone = $('#phone').val();

			// 当点击a连接的时候，发送ajax请求到服务器（发送短信）
			$.post('<?php echo U("Login/msg");?>', {phone:phone}, function(msg){
				// console.log(msg);
				if (msg.status == 0) {
					alert('发送成功');
				} else {
					alert('发送失败');
				}
			})
		})
	})
	</script>
</body>
</html>